<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Nodes feature usage API | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'cluster-nodes-usage.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/cluster-nodes-usage.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/cluster-nodes-usage.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/cluster-nodes-usage.html" rel="nofollow" target="_blank">../en/cluster-nodes-usage.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="rest-apis.html">REST APIs</a></span>
»
<span class="breadcrumb-link"><a href="cluster.html">Cluster APIs</a></span>
»
<span class="breadcrumb-node">Nodes feature usage API</span>
</div>
<div class="navheader">
<span class="prev">
<a href="cluster-update-settings.html">« Cluster update settings API</a>
</span>
<span class="next">
<a href="cluster-nodes-hot-threads.html">Nodes hot threads API »</a>
</span>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="cluster-nodes-usage"></a>Nodes feature usage API<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/cluster/nodes-usage.asciidoc">edit</a>
</h2>
</div></div></div>

<p>Returns information on the usage of features.</p>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="cluster-nodes-usage-api-request"></a>Request<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/cluster/nodes-usage.asciidoc">edit</a>
</h3>
</div></div></div>
<p><code class="literal">GET /_nodes/usage</code><br></p>
<p><code class="literal">GET /_nodes/&lt;node_id&gt;/usage</code><br></p>
<p><code class="literal">GET /_nodes/usage/&lt;metric&gt;</code><br></p>
<p><code class="literal">GET /_nodes/&lt;node_id&gt;/usage/&lt;metric&gt;</code></p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="cluster-nodes-usage-api-desc"></a>Description<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/cluster/nodes-usage.asciidoc">edit</a>
</h3>
</div></div></div>
<p>The cluster nodes usage API allows you to retrieve information on the usage
of features for each node. All the nodes selective options are explained
<a class="xref" href="cluster.html#cluster-nodes" title="Node specification">here</a>.</p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="cluster-nodes-usage-api-path-params"></a>Path parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/cluster/nodes-usage.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">&lt;metric&gt;</code>
</span>
</dt>
<dd>
<p>
(Optional, string) Limits the information returned to the specific metrics.
A comma-separated list of the following options:
</p>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">_all</code>
</span>
</dt>
<dd>
Returns all stats.
</dd>
<dt>
<span class="term">
<code class="literal">rest_actions</code>
</span>
</dt>
<dd>
Returns the REST actions classname with a count of the number of times
that action has been called on the node.
</dd>
</dl>
</div>
</dd>
<dt>
<span class="term">
<code class="literal">&lt;node_id&gt;</code>
</span>
</dt>
<dd>
(Optional, string) Comma-separated list of node IDs or names used to limit
returned information.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="cluster-nodes-usage-api-query-params"></a>Query parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/cluster/nodes-usage.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">master_timeout</code>
</span>
</dt>
<dd>
(Optional, <a class="xref" href="common-options.html#time-units" title="Time units">time units</a>) Specifies the period of time to wait for
a connection to the master node. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to <code class="literal">30s</code>.
</dd>
<dt>
<span class="term">
<code class="literal">timeout</code>
</span>
</dt>
<dd>
(Optional, <a class="xref" href="common-options.html#time-units" title="Time units">time units</a>) Specifies the period of time to wait for
a response. If no response is received before the timeout expires, the request
fails and returns an error. Defaults to <code class="literal">30s</code>.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="cluster-nodes-usage-api-example"></a>Examples<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/cluster/nodes-usage.asciidoc">edit</a>
</h3>
</div></div></div>
<p>Rest action example:</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET _nodes/usage</pre>
</div>
<div class="console_widget" data-snippet="snippets/1402.console"></div>
<p>The API returns the following response:</p>
<div class="pre_wrapper lang-console-result">
<pre class="programlisting prettyprint lang-console-result">{
  "_nodes": {
    "total": 1,
    "successful": 1,
    "failed": 0
  },
  "cluster_name": "my_cluster",
  "nodes": {
    "pQHNt5rXTTWNvUgOrdynKg": {
      "timestamp": 1492553961812, <a id="CO550-1"></a><i class="conum" data-value="1"></i>
      "since": 1492553906606, <a id="CO550-2"></a><i class="conum" data-value="2"></i>
      "rest_actions": {
        "org.elasticsearch.rest.action.admin.cluster.RestNodesUsageAction": 1,
        "org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction": 1,
        "org.elasticsearch.rest.action.document.RestGetAction": 1,
        "org.elasticsearch.rest.action.search.RestSearchAction": 19, <a id="CO550-3"></a><i class="conum" data-value="3"></i>
        "org.elasticsearch.rest.action.admin.cluster.RestNodesInfoAction": 36
      }
    }
  }
}</pre>
</div>
<div class="calloutlist">
<table border="0" summary="Callout list">
<tr>
<td align="left" valign="top" width="5%">
<p><a href="#CO550-1"><i class="conum" data-value="1"></i></a></p>
</td>
<td align="left" valign="top">
<p>Timestamp for when this nodes usage request was performed.</p>
</td>
</tr>
<tr>
<td align="left" valign="top" width="5%">
<p><a href="#CO550-2"><i class="conum" data-value="2"></i></a></p>
</td>
<td align="left" valign="top">
<p>Timestamp for when the usage information recording was started. This is
equivalent to the time that the node was started.</p>
</td>
</tr>
<tr>
<td align="left" valign="top" width="5%">
<p><a href="#CO550-3"><i class="conum" data-value="3"></i></a></p>
</td>
<td align="left" valign="top">
<p>Search action has been called 19 times for this node.</p>
</td>
</tr>
</table>
</div>
</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="cluster-update-settings.html">« Cluster update settings API</a>
</span>
<span class="next">
<a href="cluster-nodes-hot-threads.html">Nodes hot threads API »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>